package com.xm.rsi.utils;

import cn.hutool.crypto.digest.DigestUtil;

import java.util.Base64;

public class TokenGenerator {

    public static String generateToken(String userEmail, String userPassWord, long time, String authToken) {
        String md5Hex = DigestUtil.md5Hex(userEmail + ":" + userPassWord + ":" + time + ":" + authToken);
        return Base64.getEncoder().encodeToString((userEmail + ":" + time + ":" + md5Hex).getBytes());
    }
}
